<?php
namespace app\index\controller;
use \think\Config;
use think\View;
use think\Db;
use think\Controller;
use think\Session;
use think\Cache;
use think\Request;
use flc\alidayu\Client;
use flc\alidayu\App;
use flc\alidayu\Requests\AlibabaAliqinFcSmsNumSend;
class Index
{


    /*   public function sendCode() {
          $tel = '18811141365';
          $code='1111';
          $c = new TopClient;
          $c->appkey = Config::get("top.appkey");//appkey
          $c->secretKey = Config::get("top.secret");//appSec
          $req = new AlibabaAliqinFcSmsNumSendRequest;
          $req->setExtend("123456");
          $req->setSmsType("normal");
          $req->setSmsFreeSignName("飞鸟之巢");
          $req->setSmsParam("{\"code\":\"$code\"}");//我这个模板用了四个参数
          $req->setRecNum($tel);
          $req->setSmsTemplateCode("SMS_7470690");//模板
          $resp = $c->execute($req);
          return $resp;
      } */

      public function demo()
      {
        echo 123;
      }
      
      // public function azx(){
      //             $request = Request::instance();
      //             if ($request->isPost()) {
      //                 $mobile = $request->only(['mobile']);
      //                 foreach($mobile as $k=>$v){
      //                     if(is_int($k)){
      //                         unset($mobile[$k]);
      //                     }
      //                 }
      //                  $code=rand(100000,999999);
      //                     // 配置信息
      //                  $config = [
      //                         'app_key'    => '23343089',
      //                         'app_secret' => 'a363385dd5a97c82dfb3af93381cccc4',
      //                     ];
      //                     $client = new Client(new App($config));
      //                     $req    = new AlibabaAliqinFcSmsNumSend;
      //                     $req->setRecNum('13312311231')
      //                     ->setSmsParam([
      //                         'number' => $code
      //                     ])
      //                     ->setSmsFreeSignName('飞鸟之巢')
      //                     ->setSmsTemplateCode('SMS_7470690');
      //                     $str=$mobile['mobile'].$code;
      //                     $cryptStr = Crypt::encrypt($str);  // 加密
      //                     session::set('smsverify',$cryptStr);
      //                     $resp = $client->execute($req);
      //                     print_r($resp);
      //                     print_r($resp->result->model);exit;

                           
      //                 }
      //                 // return $re;
      //             }
    
}
